package com.wu.project.admin.component;

import com.wu.project.admin.util.CommonResultUtil;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author xuan
 */
@Component
public class AuthorizedResultHandler {

    public void authErrorHandler(HttpServletResponse response) {
        try {
            String json = CommonResultUtil.Instance.getObjectMapper().writeValueAsString(CommonResultUtil.Instance.authError());
            response.getWriter().write(json);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
